Skip to content

Add regex support to remapping and attributes #615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TareHimself
Copy link

@TareHimself TareHimself commented Jul 14, 2025

Fixes #614
This PR does not include tests. I created it to determine if the repo will allow regex for --remap and --with-attributes. regex support is opt-in using a separate --remap-regex and --with-attributes-regex , --remap-regex supports string formatting. These are some examples

--remap-regex
^([\w\d]+)Flags([0-9])$={0}Flags{1}
^([\w\d]+)FlagBits$=@{0}Flags

--with-attribute-regex
^Vk[\w\d]+Flags$=Flags
^Vk[\w\d]+Flags[0-9]$=Flags

if allowed I will start working on tests and this can also be added to --with-type as --with-type-regex

@tannergooding
Copy link
Member

Can you elaborate on the use case for this?

What are you hitting that requires full regex support and where the existing basic wildcard support is not sufficient?

Supporting arbitrary external regex inputs is potentially dangerous and not something I'm keen on doing. I'm happy to do limited additional extensions to the existing remapping feature, however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generating bindings is tedious for large structured codebases
2 participants